import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutterproject/util/extension/double_extension.dart';

class MarginPaddingUtil {
  static EdgeInsetsGeometry only(
      {double left = 0.0,
      double top = 0.0,
      double right = 0.0,
      double bottom = 0.0}) {
    return fromLTRB(left: left, top: top, right: right, bottom: bottom);
  }

  static EdgeInsets all(double margin) {
    return EdgeInsets.all(ScreenUtil().setSp(margin));
  }

  static EdgeInsets fromLTRB(
      {required double left,
      required double top,
      required double right,
      required double bottom}) {
    return EdgeInsets.only(
        left: ScreenUtil().setWidth(left),
        top: ScreenUtil().setHeight(top),
        right: ScreenUtil().setWidth(right),
        bottom: ScreenUtil().setHeight(bottom));
  }

  static EdgeInsets symmetric({double vertical = 0, double horizontal = 0}) {
    return EdgeInsets.symmetric(
      vertical: vertical.height,
      horizontal: horizontal.width,
    );
  }
}
